<?php
namespace app\controller;

class InitController extends BaseController
{
    // ... 其他方法保持不变 ...
    
    /**
     * 创建用户表
     */
    private function createUsersTable()
    {
        $sql = "CREATE TABLE `users` (
            `id` int(11) NOT NULL AUTO_INCREMENT,
            `username` varchar(50) NOT NULL,
            `password` varchar(255) NOT NULL,
            `email` varchar(100) NOT NULL,
            `verification_token` varchar(255) DEFAULT NULL,
            `is_verified` tinyint(1) NOT NULL DEFAULT '0',
            `reminder_key` varchar(255) DEFAULT NULL,
            `created_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '注册时间',
            `updated_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后更新时间',
            `delete_time` int(11) unsigned DEFAULT NULL COMMENT '软删除时间',
            PRIMARY KEY (`id`),
            UNIQUE KEY `username` (`username`),
            UNIQUE KEY `email` (`email`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户表'";
        
        Db::execute($sql);
    }
    
    /**
     * 创建提醒事项表
     */
    private function createRemindersTable()
    {
        $sql = "CREATE TABLE `reminders` (
            `id` int(11) NOT NULL AUTO_INCREMENT,
            `user_id` int(11) NOT NULL,
            `title` varchar(255) NOT NULL,
            `description` text,
            `due_date` int(11) unsigned DEFAULT NULL,
            `is_completed` tinyint(1) NOT NULL DEFAULT '0',
            `notes` text,
            `created_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
            `updated_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后更新时间',
            `delete_time` int(11) unsigned DEFAULT NULL COMMENT '软删除时间',
            `is_disabled` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否禁用',
            PRIMARY KEY (`id`),
            KEY `idx_user_id` (`user_id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='提醒事项表'";
        
        Db::execute($sql);
    }
} 